import { createRouter, createWebHashHistory , createWebHistory, type RouteRecordRaw } from 'vue-router'
import LayoutIndex from '@/layout/LayoutIndex.vue'
import Test from '@/views/Test.vue'
import chat1 from '@/views/Chat.vue'
import chat2 from '@/views/Chat.vue'
import { getToken } from '@/utils'

export const constantRoutes: Array<RouteRecordRaw> = [
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login/emptylogin.vue'),
        meta: { 
            title: '登录',
            hidden: true,
            NoAuth: true
        }
    },
    {
        path: '/AuthorizedToLogIn',
        name: 'AuthorizedToLogIn',
        component: () => import('@/views/AuthorizedToLogIn.vue'),
        meta: { 
            title: '授权登录',
            hidden: true,
            NoAuth: true
        }
    },
    {
        path: '/',
        component: LayoutIndex,
        redirect: '/home',
        children: [
            {
                path: 'home',
                name: 'home',
                component: () => import("@/views/Home.vue"),
                meta: {
                    title: '首页',
                    icon: 'home-filled',
                    NoAuth: true
                }
            }
        ]
    },
    {
        path: '/test',
        name: 'test',
        component: () => import('@/views/Test.vue'),
        meta: {
            title: '测试',
            hidden: false,
            NoAuth: true
        }
    },
    {
        path: '/chat',
        name: 'chatF',
        component: LayoutIndex,
        meta: { 
            title: '聊天',
            icon: 'ChatLineRound'
        },
        children: [
            {
                path: 'chat/:id',
                name: 'chat',
                component: chat1,
                meta: { 
                    title: 'Chat-one',
                    icon: 'chat-square',
                    NoAuth: true
                },
            },
            {
                path: 'chat/2',
                name: 'chatA',
                component: chat2,
                meta: { 
                    title: 'Chat-two',
                    icon: 'chat-square',
                    NoAuth: true
                },
            }
        ]
    },
    // {
    //     path: '/blueSky',
    //     component: LayoutIndex,
    //     meta: {
    //         title: '认识开放蓝天',
    //         icon: 'HelpFilled'
    //     },
    //     children: [
    //         {
    //             path: 'blueSky',
    //             name: 'blueSky',
    //             component: () => import("@/views/Cat.vue"),
    //             meta: { 
    //                 title: '认识开放蓝天',
    //                 icon: 'home-filled',
    //                 NoAuth: true
    //             }
    //         }
    //     ]
    // },
    {
        path: '/play',
        component: LayoutIndex,
        meta: { 
            title: '解锁有趣玩法',
            icon: 'Key'
        },
        children: [
            {
                path: 'play',
                name: 'play',
                component: () => import("@/views/Play.vue"),
                meta: { 
                    title: '解锁有趣玩法',
                    icon: 'home-filled',
                    NoAuth: true
                },
            }
        ]
    },
    {
        path: '/say',
        component: LayoutIndex,
        meta: { 
            title: '公告',
            icon: 'Promotion'
        },
        children: [
            {
                path: 'say',
                name: 'say',
                component: () => import("@/views/Say.vue"),
                meta: { 
                    title: '公告',
                    icon: 'home-filled',
                    NoAuth: true
                }
            }
        ]
    },
    // {
    //     path: '/relation',
    //     component: LayoutIndex,
    //     meta: { 
    //         title: '联系我们',
    //         icon: 'Promotion'
    //     },
    //     children: [
    //         {
    //             path: 'relation',
    //             name: 'relation',
    //             component: () => import("@/views/Relation.vue"),
    //             meta: { 
    //                 title: '联系我们',
    //                 icon: 'home-filled',
    //                 NoAuth: true
    //             }
    //         }
    //     ]
    // },
    {
        path: '/user',
        component: LayoutIndex,
        meta: { 
            title: '个人详情',
            icon: 'Avatar'
        },
        children: [
            {
                path: 'user',
                name: 'user',
                component: () => import("@/views/User.vue"),
                meta: { 
                    title: '个人详情',
                    icon: 'home-filled',
                    NoAuth: true
                }
            }
        ]
    },
    {
        path: '/aiDraw',
        name: 'aiDraw',
        component: () => import('@/views/application/aiDraw.vue'),
        meta: { 
            title: 'ai绘画',
            hidden: true,
            NoAuth: true
        }
    },
    {
        path: '/aiVoice',
        name: 'aiVoice',
        component: () => import('@/views/application/aiVoice.vue'),
        meta: { 
            title: 'ai语音',
            hidden: true,
            NoAuth: true
        }
    },
    {
        path: '/textRecognition',
        name: 'textRecognition',
        component: () => import('@/views/application/textRecognition.vue'),
        meta: { 
            title: '文字识别',
            hidden: true,
            NoAuth: true
        }
    },
    {
        path: '/imgRecognition',
        name: 'imgRecognition',
        component: () => import('@/views/application/imgRecognition.vue'),
        meta: { 
            title: '图像识别',
            hidden: true,
            NoAuth: true
        }
    },
    {
        path: '/imgEffects',
        name: 'imgEffects',
        component: () => import('@/views/application/imgEffects.vue'),
        meta: { 
            title: '图像增强与特效',
            hidden: true,
            NoAuth: true
        }
    },
]


export const asyncRoutes: any[] = [
]

const router = createRouter({
    history: createWebHashHistory(),
    routes: constantRoutes
})




export default router